
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
npm install ip-cidr
Module for working with CIDR (v4, v6). Based on ip-address.
const IPCIDR = require("ip-cidr");
const BigInteger = require("jsbn").BigInteger;
const cidr = new IPCIDR("50.165.190.0/23");
if(!cidr.isValid()) {
throw new Error('CIDR is invalid');
}
// get start ip address as a string
cidr.start();
// get end ip address as a big integer
cidr.end({ type: "bigInteger" });
// do something with each element of the range
cidr.loop(ip => console.log(ip), { type: "addressObject" });
// get an array of all ip addresses in the range as a big integer;
cidr.toArray({ type: "bigInteger" });
// get an array by chunks using from/limit
cidr.toArray({ from: 1, limit: new BigInteger('2') });
// get an array by chunks using from/to
cidr.toArray({ from: new BigInteger('1'), to: 3 });
cidr.toArray({ from: '50.165.190.1', to: '50.165.190.3' });
// get an array of start and end ip addresses as a string [startIpAsString, endIpAsString]
cidr.toRange();
Load /dist/ip-cidr.js as a script and you can get the library in window.IPCIDR
to return an "ip-address" module object in the necessary format
to check the address belongs to the range
to get the start ip adress
to get the end ip address
to convert the cidr to a string like "50.165.190.0/23"
to convert the cidr to an array with start and end ip addresses [startIp, endIp]
to convert the cidr to an object with start and end ip addresses {start: startIp, end: endIp}
to convert the cidr to an array with all ip addresses in the range
you can get information by chunks using options.from/options.limit or options.from/options.to
you can pass the second argument "results" (object) to get all chunk pagination information
to run fn for each element of the range
you can use the same chunk options as in .toArray()
FAQs
Module for working with CIDR (v4, v6)
The npm package ip-cidr receives a total of 93,411 weekly downloads. As such, ip-cidr popularity was classified as popular.
We found that ip-cidr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.